package com.vilicode.excel;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import java.util.Date;

public class ExcelUser {
    @ExcelProperty("用户ID")
    @ColumnWidth(10)
    private int userId;

    @ExcelProperty("用户名")
    @ColumnWidth(20)
    private String username;

    @ExcelProperty("密码")
    @ColumnWidth(20)
    private String password;

    @ExcelProperty("邮箱")
    @ColumnWidth(30)
    private String email;

    @ExcelProperty("性别")
    @ColumnWidth(10)
    private int sex;

    @ExcelProperty(value = "用户组", converter = UserGroupConverter.class)
    @ColumnWidth(20)
    private UserGroup userGroup;

    @ExcelProperty("创建时间")
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    @ColumnWidth(25)
    private Date createAt;

    @ExcelProperty("自定义字段")
    @ColumnWidth(15)
    private int customizeField;

    // Getters and Setters

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public int getSex() {
        return sex;
    }

    public void setSex(int sex) {
        this.sex = sex;
    }

    public UserGroup getUserGroup() {
        return userGroup;
    }

    public void setUserGroup(UserGroup userGroup) {
        this.userGroup = userGroup;
    }

    public Date getCreateAt() {
        return createAt;
    }

    public void setCreateAt(Date createAt) {
        this.createAt = createAt;
    }

    public int getCustomizeField() {
        return customizeField;
    }

    public void setCustomizeField(int customizeField) {
        this.customizeField = customizeField;
    }
}
